package com.corgi.webservice.service.impl;

import com.corgi.webservice.domain.User;
import com.corgi.webservice.repository.UserRepository;
import com.corgi.webservice.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.jws.WebService;
import java.util.List;

/**
 * @title: UserServiceImpl
 * @description:
 * @author: dengmiao
 * @create: 2019-10-11 21:28
 **/
@WebService(serviceName="userService",//对外发布的服务名
        targetNamespace="http://service.webservice.corgi.com/",//指定你想要的名称空间，通常使用使用包名反转
        endpointInterface="com.corgi.webservice.service.UserService")
@Component
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public User getUserById(long userId) {
        return userRepository.findById(userId);
    }

    @Override
    public List<User> getUser() {
        return userRepository.findUser();
    }
}
